<template>
	<!-- 禁止滚动 -->
<<<<<<< HEAD
	<view @touchmove.stop.prevent="() => {}">
		<view class="container">
			<userInfo :title = "this.title"></userInfo>
			<view class="index" v-show="showIndex">
=======
	<view>
		<view class="container">
			<userInfo :title="this.title"></userInfo>
			<view class="index" v-show="showIndex" @touchmove.stop.prevent="() => {}">
>>>>>>> b0cc8c0 (hello)
				<!-- 问候语 -->
				<view class="greetings">
					<view class="msg">
						<view class="time">
							<text>{{time}}</text>
						</view>
						<view class="greetingsMsg">
							<text>{{greetingsMsg}}</text>
						</view>

					</view>
<<<<<<< HEAD
					<view class="voiceBtn">
=======
					<view class="voiceBtn" @click="text()">
>>>>>>> b0cc8c0 (hello)
					</view>

				</view>

				<!-- 功能 -->
				<view class="domain">
<<<<<<< HEAD
					<view class="health">
						<view class="healthIcon">
							<image class="domainIcon" src="../../../../static/logo.png" mode=""></image>
						</view>
						<view class="healthGonICon">
							<!-- <image class="headshotImg" src="../../../../static/logo.png" mode=""></image> -->
=======
					<view class="health" @click="toHealth()">
						<view class="healthIcon">
							<image class="domainIcon" src="../../../../static/logo.png" mode=""></image>
						</view>
						<view v-if="healthNote">
							<view class="healthGonICon">
								<text>?</text>
							</view>
>>>>>>> b0cc8c0 (hello)
						</view>
						<view class="title">
							<text>健康记录</text>
						</view>

					</view>
<<<<<<< HEAD
					<view class="drug">
=======
					<view class="drug" @click="toDrug">
>>>>>>> b0cc8c0 (hello)
						<view class="drugIcon">
							<image class="domainIcon" src="../../../../static/logo.png" mode=""></image>
						</view>
						<view class="drugGonICon">
<<<<<<< HEAD
							<!-- <image class="domainIcon" src="../../../../static/logo.png" mode=""></image> -->
=======
							<text>{{drugNum}}</text>
>>>>>>> b0cc8c0 (hello)
						</view>
						<view class="title">
							<text>医药提醒</text>
						</view>

					</view>
<<<<<<< HEAD
					<view class="community">
=======
					<view class="community" @click="toCommunity">
>>>>>>> b0cc8c0 (hello)
						<view class="communityIcon">
							<image class="domainIcon" src="../../../../static/logo.png" mode=""></image>
						</view>
						<view class="title">
							<text>社区服务</text>
						</view>

					</view>
					<view class="sos" @click="sos">
						<view class="sosIcon">
							<image class="domainIcon" src="../../../../static/logo.png" mode=""></image>
						</view>
						<view class="title">
							<text>紧急呼叫</text>
						</view>

					</view>
				</view>

			</view>
<<<<<<< HEAD
			<view class="showSos" v-show="showSos">
				<sos @closeMain='closeMain'></sos>
			</view>

		</view>
=======
			<!-- 紧急呼叫 -->
			<view class="showSos" v-show="showSos">
				<sos @closeMain='closeMain' :showSos='showSos'></sos>
			</view>
			<!-- 社区 -->
			<view v-show="showCommunity">
				<oldster-community @fCommunity='fCommunity'></oldster-community>
			</view>
			<!-- 健康记录 -->
			<view v-show="showHealth">
				<oldster-health @fHealth='fHealth' @changeHealthNote='changeHealthNote'></oldster-health>
			</view>
			<!-- 医药提醒 -->
			<view v-show="showDrug">
				<oldster-drug ref="drug" @fDrug='fDrug' @getDrugListLen='getDrugListLen' ></oldster-drug>
			</view>

		</view>
		<!-- <tab-bar></tab-bar> -->
>>>>>>> b0cc8c0 (hello)
	</view>
</template>

<script>
	export default {
		data() {
			return {
				showIndex: true,
				showSos: false,
<<<<<<< HEAD
				time: '2023/3/21 三',
				greetingsMsg: '开启新的一天生活，祝您愉快！',
				title:''

			}
		},
		// props: {
		// 	showIndex:Boolean,
		// 	showSos:Boolean,
		// 	required: true
		// },

		// this.reStart();
		methods: {
			// reStart(){
			// 	if(this.kind == true){
			// 	this.showIndex = true;
			// 	this.showSos = false;
			// 	}
			// },
=======
				showCommunity: false,
				showHealth: false,
				showDrug: false,
				time: '2023/3/21 三',
				greetingsMsg: '开启新的一天生活，祝您愉快！',
				title: '',
				healthNote: true,
				drugNum: '0',

			}
		},
		onLoad() {
			console.log('onload');
		},


		// this.reStart();
		methods: {
			text(){
				
			},
			toCommunity() {
				this.title = '社区服务'
				this.showIndex = false;
				this.showCommunity = true;
			},
			fCommunity(val) {
				this.showIndex = val.showIndex;
				this.showCommunity = val.showCommunity;
				this.title = val.title;
				console.log(JSON.stringify(val));
			},
			toHealth() {
				this.title = '健康记录'
				this.showIndex = false;
				this.showHealth = true;
			},
			fHealth(val) {
				this.showIndex = val.showIndex;
				this.showHealth = val.showHealth;
				this.title = val.title;
				console.log(JSON.stringify(val));
			},
			changeHealthNote(val) {
				this.healthNote = val.healthNote;
				console.log(JSON.stringify(val));
			},
			fDrug(val) {
				this.showIndex = val.showIndex;
				this.showDrug = val.showDrug;
				console.log(JSON.stringify(val));
			},
			toDrug() {
				this.title = '医药提醒';
				this.showIndex = false;
				this.showDrug = true;
			},
			getDrugListLen(val) {
				this.drugNum = val.drugNum;
				console.log(JSON.stringify(val));
			},

>>>>>>> b0cc8c0 (hello)
			closeMain(val) {
				// this.model = val;
				this.showIndex = val.showIndex;
				this.showSos = val.showSos;
				this.title = val.title;
				console.log(JSON.stringify(val));
			},
<<<<<<< HEAD

			//紧急呼叫
			sos() {
				this.title = '紧急呼叫'
				this.showIndex = false;
				this.showSos = true;
				// 导入Activity、Intent类  
				var Intent = plus.android.importClass("android.content.Intent");
				var Uri = plus.android.importClass("android.net.Uri");
				// 获取主Activity对象的实例  
				var main = plus.android.runtimeMainActivity();
				// 创建Intent  
				var uri = Uri.parse("tel:10086"); //电话号码  
				var call = new Intent("android.intent.action.CALL", uri);
				// 调用startActivity方法拨打电话  
				main.startActivity(call);
				console.log('呼叫成功');
=======
			//紧急呼叫
			sos() {

				this.title = '紧急呼叫'
				this.showIndex = false;
				this.showSos = true;
			},

			//获取每日健康记录
			getHealthNote() {
				this.$request.get('/Health/GetHealthToday', {}).then(data => {
					console.log('data', data);
					if (data.data.code == '200') {
						if (data.data.data.bloodLow == '' || data.data.data.bloodPressure == '' || data.data.data.bloodSugar == '') {
							this.healthNote = true;
						} else {
							this.healthNote = false;
						}
					}
				})
>>>>>>> b0cc8c0 (hello)
			}

		}
	}
</script>

<style>
	.container {
		height: 100vh;
		width: 100vw;
	}

	.greetings {
		height: 25vh;
		width: 90%;
		background-color: #ffffff;
		/* border: 1rpx solid #000000; */
		border: 1px solid #bfbfbf;
		box-shadow: 0 0 10px 2px #bdcee0;
		display: flex;
		/* justify-content: center; */
		justify-content: left;
		margin: 0 auto;
		position: relative;
		top: -10vh;
		border-radius: 4vw;
		z-index: 999;

	}

	.msg {
		display: block;
		justify-content: left;
		width: 80%;
		height: 180rpx;
		margin-top: 2vh;
		margin-left: 4vw;
		line-height: 80rpx;
	}

	.time {
		/* 	height: 80rpx;
		width: 50%;
		white-space: nowrap;
		font-size: 42rpx; */
		width: 100%;
		font-size: 42rpx;
		font-weight: bold;
		white-space: nowrap;
		color: #BF4E12;
	}

	.greetingsMsg {
		width: 100%;
		font-size: 48rpx;
		/* letter-spacing: 2rpx; */
		text-align: left;
		margin-top: 3vh;
		margin-left: 5vw;
	}

	.voiceBtn {
		/* justify-content: right; */
		width: 80rpx;
		height: 80rpx;
		border-radius: 50%;
		float: right;
		margin-top: 3vh;
		/* background-color: #007AFF; */
		background-image: url(../../../../static/logo.png);
		overflow: hidden;
		background-size: cover;
	}

	.domain {
		height: 50vh;
		width: 90%;
		/* background-color: #007AFF; */
		margin: 0 auto;
		/* display: flex; */
		/* justify-content: center; */
		position: relative;
		top: -8vh;
	}

	.health,
	.drug,
	.community,
	.sos {
		background-color: #999999;
		height: 330rpx;
		width: 330rpx;
		border-radius: 2vh;
	}

	.health,
	.community {
		/* display: none; */
		float: left;
		/* justify-content: left; */
	}

	.drug,
	.sos {
		/* display: none; */
		/* justify-content: right; */
		/* margin-top: 5%; */
		float: right;
	}

	.community,
	.sos {
		margin-top: 5%;
	}

	.health {
		background-color: #7FD6DE;
	}

	.drug {
		background-color: #F6AC1D;
	}

	.community {
		background-color: #40CDEC;
	}

	.sos {
		background-color: #FF9A9A;
	}

	.healthIcon,
	.drugIcon,
	.communityIcon,
	.sosIcon {
		width: 100rpx;
		height: 100rpx;
		background-color: #007AFF;
		border-radius: 50%;
		/* border: 5rpx solid #bfbfbf; */
		border: 20rpx solid hsla(0, 0%, 100%, .5);
		background-clip: padding-box;
		margin: 0 auto;
		margin-top: 3vh;
		overflow: hidden;
		position: relative;
	}
<<<<<<< HEAD
	
	.domainIcon{
		max-width: 100%;
		max-height: 100%;
	}
	
	.healthGonICon{
		width: 75rpx;
		height: 75rpx;
		position: absolute;
		z-index: 999;
		top: 3vh;
		left: 31vw;			
		/* right: 10vw; */
		/* float: right; */
		/* margin: 0 auto; */
=======

	.domainIcon {
		max-width: 100%;
		max-height: 100%;
	}

	.healthGonICon {
		width: 75rpx;
		height: 75rpx;
		position: absolute;
		text-align: center;
		font-size: 48rpx;
		line-height: 80rpx;
		z-index: 999;
		top: 3vh;
		left: 31vw;
>>>>>>> b0cc8c0 (hello)
		background-color: #F6681D;
		color: #ffffff;
		border-radius: 50%;
	}
<<<<<<< HEAD
	
	.drugGonICon{
		width: 75rpx;
		height: 75rpx;
		position: absolute;
		z-index: 999;
		top: 3vh;
		right: 3vw;			
		/* right: 10vw; */
		/* float: right; */
		/* margin: 0 auto; */
=======

	.drugGonICon {
		width: 75rpx;
		height: 75rpx;
		position: absolute;
		text-align: center;
		font-size: 48rpx;
		line-height: 80rpx;
		z-index: 999;
		top: 3vh;
		right: 3vw;
		font-size: ;
>>>>>>> b0cc8c0 (hello)
		background-color: #F6681D;
		color: #ffffff;
		border-radius: 50%;
	}
<<<<<<< HEAD
	
	.title{
=======

	.title {
>>>>>>> b0cc8c0 (hello)
		width: 100%;
		text-align: center;
		margin-top: 3vh;
		font-size: 52rpx;
		font-weight: bold;
	}
</style>
